package com.mycompany;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Person implements Serializable {
    private Long id;
    private String name;
    private Person managedBy;
    private List<Person> manages;


    public Person(Long id, String name, Person managedBy, List<Person> manages) {
		super();
		this.id = id;
		this.name = name;
		this.managedBy = managedBy;
		this.manages = manages;
	}

	public Person() {
		super();
	}

	/**
     * Used to display the person.
     */
    public String toString() {
        return name;
    }

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Person getManagedBy() {
		return managedBy;
	}

	public void setManagedBy(Person managedBy) {
		this.managedBy = managedBy;
	}

	public List<Person> getManages() {
		return manages;
	}

	public void setManages(List<Person> manages) {
		this.manages = manages;
	}

	/**
     * Gets the list of possible managers from the database.
     */
    public static List<Person> getManagers() {
        // gets the managers from the database
    	ArrayList tempList = new ArrayList();
    	Person ZeBigBoss = new Person(new Long(1),"ZeBigBoss",null, new ArrayList());
    	tempList.add(ZeBigBoss);
    	Person John = new Person(new Long(2),"John",null, new ArrayList());
    	tempList.add(John);
    	Person Jack = new Person(new Long(3),"Jack",null, new ArrayList());
    	tempList.add(Jack);
    	Person Mary = new Person(new Long(4),"Mary",null, new ArrayList());
    	tempList.add(Mary);
    	Person July = new Person(new Long(5),"July",null, new ArrayList());
    	tempList.add(July);
    	Person Dave = new Person(new Long(6),"Dave",null, new ArrayList());
    	tempList.add(Dave);
    	Person Chris = new Person(new Long(7),"Chris",null, new ArrayList());
    	tempList.add(Chris);
    	return tempList;
    }
}
